<%@ Page Language="VB" MasterPageFile="~/MasterPageExpandable.master" AutoEventWireup="false" CodeFile="Upload.aspx.vb" Inherits="DataLoad_Upload" title="CDM Data Load Tool - Upload Page" %>

<%@ Register Src="DataLoadSubNavControl.ascx" TagName="DataLoadSubNavControl" TagPrefix="uc1" %>
<%@ Register Assembly="InputControls" Namespace="InputControls" TagPrefix="cc2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script language="javascript">
    function SelectAllCheckboxes(spanChk){

        var oItem = spanChk.children;
        var theBox = (spanChk.type=="checkbox")?spanChk:spanChk.children.item[0];

        xState = theBox.checked;
        elm = theBox.form.elements;

        for(i=0;i<elm.length;i++)

            if(elm[i].type=="checkbox" && elm[i].id!=theBox.id) {

                if(elm[i].checked!=xState)
                    elm[i].click();

            }

    }
    
    function alignDivs(scrollGridViewDiv, nameGridViewDiv, detailHeaderDiv)
    {
      //alert('b');
      var scrollDiv=document.getElementById(scrollGridViewDiv);
      var nameDiv=document.getElementById(nameGridViewDiv);
      var hdrDiv=document.getElementById(detailHeaderDiv);
      
      //alert(scrollDiv);
      //alert(nameDiv);
      //alert(hdrDiv);
      
      //alert('c');
      nameDiv.scrollTop=scrollDiv.scrollTop;
      hdrDiv.scrollLeft=scrollDiv.scrollLeft;
      //alert('d');
    }
    
</script>
 <uc1:DataLoadSubNavControl ID="DataLoadSubNavControl1" runat="server" />
 <table width="875" cellspacing="0" cellpadding="1">
<tr><td style="width:50%; text-align:left; vertical-align:top;"><h1><a id="pagecontent">Data Load Tool - Upload Page</a></h1></td>
 <td style="width:50%; text-align:right; vertical-align:top;"><asp:LinkButton ID="ShowFileLinkButton" runat="server" Text="Upload Another File" CssClass="labelSmallNoWidthOrAlign" Visible="false"></asp:LinkButton> </td>
 </tr>
 </table>
<asp:Panel ID="PagePanel" runat="server" Width="960px" Height="310px" ScrollBars="Auto" Visible="false">
 <table width="875" cellspacing="0" cellpadding="1">
  <tr>
  <td width="175" valign="top">
          <cc2:ScrollingGridView ID="ParticipantNameScrollingGridView" ToolTip="140" ShowFooter="false" IsFixedColumn="true" 
              ShowScrollBars="false"  runat="server" Caption="Uncheck a row to exclude it from upload." CssClass="gridOffsetSmall" Width="175px" AutoGenerateColumns="False" PageSize="40" AllowPaging="false" DataKeyNames="ParticipantId" 
              CellPadding="5" CellSpacing="0" BorderColor="Gray" BorderStyle="Solid" GridLines="Both" EmptyDataText="No active participants are associated with you." AllowSorting="True">
              <HeaderStyle CssClass="adminHeaderStyle" Height="28" BackColor="#C3CAD4" BorderColor="#21334B" VerticalAlign="Top" />
        <RowStyle CssClass="adminColumnStyle" Height="26" />
          <Columns>
            <asp:TemplateField HeaderText="Upload">
            <ItemStyle Width="80px" />
            <HeaderStyle Width="85px" />
            <ItemTemplate>
                <asp:CheckBox ID="uploadCheckBox" runat="server" Checked="true" />
            </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField HeaderText="Id" DataField="ParticipantId" ItemStyle-Width="50px" HeaderStyle-Width="50px" />
           <asp:BoundField HeaderText="First Name" DataField="FirstName" ItemStyle-Width="90px" HeaderStyle-Width="90px" />
           <asp:BoundField HeaderText="Last Name" DataField="LastName" ItemStyle-Width="90px" HeaderStyle-Width="90px" />
          </Columns>
          <AlternatingRowStyle BackColor="#C3CAD4" />
          <EmptyDataRowStyle CssClass="label" HorizontalAlign="Center" />
          </cc2:ScrollingGridView>
  </td>
  <td width="650" valign="top">
           <cc2:ScrollingGridView ID="ParticipantDetailsScrollingGridView" ToolTip="140" InnerDivWidth="580" IsFixedColumn="true" Caption="The columns marked (r) are read only to you; changes to them will not be saved." runat="server" CssClass="gridOffsetSmall" AutoGenerateColumns="False" PageSize="40" AllowPaging="false" DataKeyNames="ParticipantId,LegalGuardianId,ParticipantRepresentativeId" 
             CellPadding="5" CellSpacing="0" BorderColor="Gray" BorderStyle="Solid" GridLines="Vertical" EmptyDataText="No active participants are associated with you." AllowSorting="True">
             <HeaderStyle CssClass="adminHeaderStyle" Height="16" BackColor="#C3CAD4" BorderColor="#21334B" VerticalAlign="Top" />
        <RowStyle CssClass="adminColumnStyle" Height="26"  />
            <AlternatingRowStyle BackColor="#E8ECF4" />
            <EmptyDataRowStyle CssClass="label" HorizontalAlign="Center" />
           </cc2:ScrollingGridView>
  </td>
  </tr>
  <tr>
  <td></td></tr>
</table>
</asp:Panel>
<asp:Panel ID="UploadFilePanel" runat="server" Visible=True>
<table style="width:825px;">
<tr><td width="400px"></td><td class="labelNoAlign" align="left">Select File to Upload</td></tr>
<tr><td></td><td align="left"><asp:FileUpload ID="UploadFile" runat="server" /></td></tr>
<tr><td></td><td align="left"><asp:Button ID="UploadButton" runat="server" Text="Upload" /></td></tr>
</table>

</asp:Panel>


</asp:Content>
<asp:Content ID="FixedContent" runat="server" ContentPlaceHolderID="ContentPlaceHolder2">
    <table style="width:800px;"><tr><td align="center"><asp:Button ID="SaveButton" runat="server" Text="Save" Visible="false" /><asp:Label ID="ConfirmSuccessLabel" CssClass="labelFont" ForeColor="Red" runat="server" Text="File(s) have been saved." Visible="false"></asp:Label></td>
</tr></table>
</asp:Content>
